import request from '@/utils/request'

const department_url = '/company/department'

// 获取部门列表
export const getDepartmentAPI = () =>
  request({
    url: department_url
  })

// 添加部门
export const addDepartmentAPI = data =>
  request({
    url: department_url,
    method: 'post',
    data
  })

// 删除部门
export const delDepartmentAPI = id =>
  request({
    url: `${department_url}/${id}`,
    method: 'DELETE'
  })

// 编辑部门
export const editDepartmentAPI = (id, data) =>
  request({
    url: `${department_url}/${id}`,
    method: 'PUT',
    data
  })

// 获取详情
export const getDepartmentInfoAPI = id =>
  request({
    url: `${department_url}/${id}`
  })
